package cn.com.smart.module.tool.database.controller;

import cn.com.smart.framework.web.controller.BaseController;
import cn.com.smart.module.tool.database.domain.columns;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/system/databsae/")
public class ColumnsController extends BaseController {

    @Autowired
   private cn.com.smart.module.tool.database.service.columnservice columnservice;

    /**
     * 根据数据库名，表名，查询表字段
     * @param tableName
     * @return
     */
    @RequestMapping("/columnsList")
    @ResponseBody
    public List<columns> selectColumnsByname(String tableName){
        System.out.println(tableName);
        return columnservice.selectColumnsByTableName(tableName);
    }

}
